﻿using PennApps;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.UI;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Media;

namespace MyMumsPC
{
    public class ResourceIntensity2ColorConverter : IValueConverter
    {
        static SolidColorBrush LightGreen = new SolidColorBrush(Windows.UI.Colors.LightGreen);
        static SolidColorBrush Red = new SolidColorBrush(Colors.DarkRed);
        static SolidColorBrush Yellow = new SolidColorBrush(Colors.Yellow);
        public object Convert(object value, Type targetType, object parameter, string language)
        {
            switch((ResourceIntensity)value)
            {
                case ResourceIntensity.High:
                    {
                        return Red;
                    }
                case ResourceIntensity.Low:
                    {
                        return LightGreen;
                    }
                case ResourceIntensity.Normal:
                    {
                        return Yellow;
                    }
                default:
                    return null;
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, string language)
        {
            throw new NotImplementedException();
        }
    }

    public class String2ValueConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, string language)
        {
            return int.Parse(value.ToString());
        }

        public object ConvertBack(object value, Type targetType, object parameter, string language)
        {
            throw new NotImplementedException();
        }
    }
}
